#include <iostream>
#include <cstdio>
#include <stack>
#include <string>
using namespace std;
//string a;
int a, b, c, d;
int main()
{
    scanf("%d-%d-%d-%d", &a, &b, &c, &d);
    int shiBieMa = 0;
    int sum = 0;
    int b_1 = b, c_1 = c;
    sum += a * 1;

    for (int i = 4; i >= 2; i--)
    {
        sum += b % 10 * i;
        b = b / 10;
    }

    for (int i = 9; i >= 5; i--)
    {
        sum += c % 10 * i;
        c = c / 10;
    }

    shiBieMa = sum % 11;
    if (int(d) - 48 == shiBieMa)
    {
        cout << "Right" << endl;
    }
    else
    {
        printf("%d-%d-%d-%c", a, b_1, c_1, (char(shiBieMa) + 48));
    }
}